package com.moerlong.platform.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.moerlong.platform.service.utils.R;

@RestController
public class TestController {
	@RequestMapping(value = "/add", method = RequestMethod.GET)
	public R add(@RequestParam(value="a") int a, @RequestParam(value="b") int b)
	{
		return R.ok().put("result", a+b);
	}
	@RequestMapping(value = "/subtract", method = RequestMethod.GET)
	public R subtract(@RequestParam(value="a") int a, @RequestParam(value="b") int b)
	{
		return R.ok().put("result", a-b);
	}
	@RequestMapping(value = "/health", method = RequestMethod.GET)
	public Map health()
	{
		Map map = new HashMap();
		map.put("status", "UP");
		return map;
	}
}
